<?php Yii::app()->clientScript->registerScript('makeEditor', "
        $('#editorarea').markItUp(mySettings);
        
 ", CClientScript::POS_END); ?>



<?php 
$form = $this->beginWidget('bootstrap.widgets.BootActiveForm', array(
	'id'=>'input-form',
	'enableAjaxValidation'=>false,
    'htmlOptions'=>array('class'=>'well'),
)); ?>

<fieldset>
	<?php echo $form->errorSummary($model); ?>
    <?php echo $form->textAreaRow($model, 'body', array('rows'=>10, 'id'=>'editorarea')); ?>
    <?php echo $form->textAreaRow($model, 'header', array('rows'=>3, 'id'=>'headerarea', 'colapse'=>true)); ?>
    <?php echo $form->textAreaRow($model, 'footer', array('rows'=>3, 'id'=>'footerarea')); ?>
    <?php echo $form->textFieldRow($model, 'number', array('prepend'=>'<i class="icon-repeat"></i>', 'hint'=>Yii::t('view', 'How often should this setting be repeated?'))); ?>
    <?php echo $form->checkBoxRow($model, 'download'); ?>
    <?php echo $form->dropDownListRow($model, 'format', $model->formatOptions); ?>
    <?php echo $form->dropDownListRow($model, 'endpoint', $model->endpoints); ?>
    <?php echo $form->textAreaRow($model, 'comment', array('rows'=>3, 'id'=>'commentarea')); ?>
</fieldset>

<div class="form-actions">
    <?php $this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'type'=>'primary', 'icon'=>'ok white', 'label'=>Yii::t('view', 'Submit'))); ?>
    <?php 
    $this->widget('bootstrap.widgets.BootButton', array(
		    'label' => Yii::t('view', 'Reset'),
			'icon' => 'icon-remove',
      		'url' => array('/site/index'),
		));
	?> <?php
	if (History::isLastSubmittedTemplateAvailable()) {
		$this->widget('bootstrap.widgets.BootButton', array(
			    'label' => Yii::t('view', 'Reload last submitted template'),
				'icon' => 'icon-repeat',
				'htmlOptions'=>array('class'=>'pull-right'),
	      		'url' => array('/site/index', 'id'=>History::getLastSubmittedTemplateId()),
			));
	}
	?> 
</div>

<?php $this->endWidget(); ?>

